

<%@ page import="com.surelution.projects.crm.CompetitorStation" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'competitorStation.label', default: 'CompetitorStation')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
        </div>
        <div class="body">
            <h1><g:message code="default.edit.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${competitorStationInstance}">
            <div class="errors">
                <g:renderErrors bean="${competitorStationInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${competitorStationInstance?.id}" />
                <g:hiddenField name="version" value="${competitorStationInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name"><g:message code="competitorStation.name.label" default="Name" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" value="${competitorStationInstance?.name}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="address"><g:message code="competitorStation.address.label" default="Address" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'address', 'errors')}">
                                    <g:textField name="address" value="${competitorStationInstance?.address}" />
                                </td>
                            </tr>
                        
                           <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="station"><g:message code="ownStation.station.label" default="station" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'station', 'errors')}">
                                    <g:select name="station.id" from="${com.surelution.projects.crm.OwnStation.list()}" optionKey="id" optionValue="shortName"  value="${competitorStationInstance?.station?.id}"/>
                                </td>
                            </tr>
                            
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="company"><g:message code="competitorStation.company.label" default="Company" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'company', 'errors')}">
                                    <g:select name="company.id" from="${com.surelution.projects.crm.CompetitorCompany.list()}" optionKey="id" optionValue="name"  value="${competitorStationInstance?.company?.id}"/>
                                </td>
                            </tr>
                        

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="managerTel"><g:message code="competitorStation.managerTel.label" default="managerTel" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'managerTel', 'errors')}">
                                    <g:textField name="managerTel" value="${competitorStationInstance?.managerTel}" />
                                </td>
                            </tr>

                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="manager"><g:message code="competitorStation.manager.label" default="manager" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'manager', 'errors')}">
                                    <g:textField name="manager" value="${competitorStationInstance?.manager}" />
                                </td>
                            </tr>
                                                          
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="hasShop"><g:message code="competitorStation.hasShop.label" default="hasShop" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: competitorStationInstance, field: 'hasShop', 'errors')}">
                                   <select name="hasShop" style="margin-right:100px;" value="${competitorStationInstance?.hasShop}" >
    										<option value="true">是</option>
    										<option value="false">否</option>
							    	</select>
							    	
                                </td>
                            </tr>      
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
